/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.james.handup;

import java.util.ArrayList;
import java.util.Random;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;

/**
 *
 * @author Administrator
 */
@WebService(serviceName = "LottoWS")
public class LottoWS {

    /** This is a sample web service operation */
    @WebMethod(operationName = "hello")
    public String hello(@WebParam(name = "name") String txt) {
        return "Hello " + txt + " !";
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "generate")
     public ArrayList generate() {
        
        ArrayList numbers = new ArrayList();
        
        Random generator = new Random();
        int x=0;
        while ( x<=5){
            int randNum = generator.nextInt(42);
            if(randNum >0){
                numbers.add(randNum);
                x++;
            } 
        }
        return numbers;
    }
}
